//
//  ViewController.m
//  07-UItabBarController-练习
//
//  Created by 王道林 on 16/7/22.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    // 练习 3  : 通过点击按钮, 实现模态出一个新的navigationController
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(100, 100, 300, 300);
    button.backgroundColor = [UIColor redColor];
    [self.view addSubview: button];
    
    [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    
    
}

- (void)buttonAction:(UIButton *)button
{
    fourViewController *fourVc = [[fourViewController alloc] init];
    UINavigationController *naviOf = [[UINavigationController alloc] initWithRootViewController:fourVc];
    [self presentViewController:naviOf animated:YES completion:nil];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
